<?php
namespace app\validate;
use share\validate\SceneValidate;

class OpenAppValidate extends SceneValidate{

    /**
     * 通用规则
     */
    protected $rule = [
        'id' => 'require|integer',
        'app_id' => 'require|length:1,50',
        'name' => 'require|length:1,50',
        'is_inner' => 'require|integer',
        'state' => 'require|integer',
        'remark' => 'length:1,200',
        'contacts' => 'require|length:1,100',
    ];    

    /**
     * 自定义场景的规则
     */
    protected $sceneRules = [
        'list' =>[          
            'app_id' => 'length:1,50',
            'name' => 'length:1,50',
            'is_inner' => 'integer',
            'state' => 'integer',
        ],
    ];

    protected $scene = [
        'list' => ['app_id','name','is_inner','state'],
        'set' => ['id','name','remark','contacts','is_inner','state'],
        'del'  => ['id'],
    ];
}
